﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class reg : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnReg_Click(object sender, EventArgs e)
    {
       
    }
 
    protected void cmdReg_Click(object sender, EventArgs e)
    {
        string strErr = "";
        if (this.txtUserName.Text.Trim().Length == 0)
        {
            strErr += "UserName不能为空！\\n";
        }
        if (this.txtPassport.Text.Trim().Length == 0)
        {
            strErr += "Passport不能为空！\\n";
        }
        if (this.txtEmail.Text.Trim().Length == 0)
        {
            strErr += "Email不能为空！\\n";
        }


        String Passport = com.BLL.laibendi.CUtil.Md5(this.txtPassport.Text);


        string UserName = this.txtUserName.Text;
       
        string Email = this.txtEmail.Text;
        com.Model.laibendi.T_Member model = new com.Model.laibendi.T_Member();
        model.UserName = UserName;
        model.Passport = Passport;
        model.Email = Email;
        model.Mobile = "";
        model.Province = "";
        model.City = "";
        model.Country = "";
        model.Address = "";
        model.RegisterIp = Request.UserHostAddress;
        model.RegisterTime = System.DateTime.Now;

        com.BLL.laibendi.T_Member bll = new com.BLL.laibendi.T_Member();

        bll.Add(model);


    }
    protected void cmdLogin_Click(object sender, EventArgs e)
    {
        com.BLL.laibendi.T_Member bll = new com.BLL.laibendi.T_Member();

        String Passport = com.BLL.laibendi.CUtil.Md5(this.txtLoginPassport.Text);

        Boolean IsExist = bll.ExistsUserName(this.txtLoginUserName.Text,Passport);

        if (IsExist)
        {
            Response.Redirect(".");

        }

    }
}
